<template>
  <el-table
    border
    :data="tableData"
    stripe
    style="width: 100%"
    row-key="System_8_10"
  >
    <el-table-column type="selection" width="40"> </el-table-column>
    <el-table-column type="index" width="40"> </el-table-column>
    <el-table-column prop="System_8_20" label="按钮名称"> </el-table-column>
    <el-table-column prop="System_8_30" label="按钮ID"> </el-table-column>
    <el-table-column prop="System_8_60" label="顺序号"> </el-table-column>
    <el-table-column label="操作" width="180">
      <template slot-scope="scope">
        <el-button
          size="mini"
          @click="handleEdit(scope.row)"
          icon="el-icon-edit"
          >编辑</el-button
        >
        <el-button size="mini" icon="el-icon-delete">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import sys8Edit from "./sys8Edit";
export default {
  data: function() {
    return {
      tableData: this.data
    };
  },
  props: {
    data: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  computed: {},
  mounted() {},
  watch: {
    data(v) {
      this.tableData = v;
    }
  },
  methods: {
    handleEdit(form) {
      this.getsys8edit().show({ form: { ...form } });
    },
    getsys8edit() {
      let edit = this.$window(sys8Edit, "编辑按钮");
      edit.$on("onSys8Save", (...data) => {
        this.$emit("onSys8Save", ...data);
      });
      return edit;
    }
  }
};
</script>

<style></style>
